package com.newtouch.bxzs.business.message.threadtask;

import com.newtouch.bxzs.business.message.model.AnnouncementVO;
import com.newtouch.bxzs.business.message.service.AnnouncementService;

import java.util.concurrent.Callable;

/**
 * AnnouncementTask: 获取通知列表task
 *
 * <p>
 * <b>History:</b>
 * <table border="1">
 * <tr>
 * <th>Date</th>
 * <th>Operator</th>
 * <th>Memo</th>
 * </tr>
 * <tr>
 * <td>2021/1/21 16:13</td>
 * <td>tianshangzhu</td>
 * <td>Create</td>
 * </tr>
 * </table>
 *
 * @author tianshangzhu
 * @version 1.0.0
 * @since 1.0.0
 */
public class AnnouncementTask implements Callable<Object> {
    private final AnnouncementService announcementService;

    public AnnouncementTask(AnnouncementService announcementService) {
        this.announcementService = announcementService;
    }

    /**
     * 查询公告
     * @return Object
     */
    @Override
    public Object call(){
        // 封装查询参数
        AnnouncementVO announcementVO = new AnnouncementVO();
        // 发布状态，已发布
        announcementVO.setPublishStatus("2");
        announcementVO.setCurrentPage(1);
        // 5条通知
        announcementVO.setPageSize(5);
        // 执行查询
        return announcementService.getAnnouncementList(announcementVO);
    }
}
